unit rUtils;
interface
uses
    System.SysUtils, classes;

procedure parseLine(line: String; var ll: TStringlist);

implementation
procedure parseLine(line: String; var ll: TStringlist);
var
    index: Integer;
begin
    ll.clear;
    line := trim(line);
    index := pos(' ', line);
    while (index > 0) OR ((pos('"', line) > 0) AND (length(line) > 1)) do
    begin
        if line[1] = '"' then
        begin
            delete(line, 1, 1);
            if pos('"', line) > 0 then
            begin
                index := pos('"', line);
                delete(line, index, 1);
            end;
        end;

        ll.add(copy(line, 1, index - 1));

        delete(line, 1, index);
        line := trim(line);
        index := pos(' ', line);
    end;
    if length(line) > 0 then
        ll.add(line);
end;
end.

